home *** CD-ROM | disk | FTP | other *** search
/ Larry Magid's Essential Internet / Larry Magid's Essential Internet (Quarterdeck Corporation)(1995).ISO / qsockpro.qip / MAUINET.MPS < prev    next >
Text File  |  1995-10-09  |  2KB  |  68 lines

  1. # Maui Global Communications PPP and SLIP login script
  2. # Copyright 1995 Quarterdeck Corporation
  3. # 5-9-95 BPD
  4.  
  5. #define the variables we will need
  6.  
  7. STRING username
  8. STRING password
  9. STRING framing
  10. STRING IPAddress
  11.  
  12. # uncomment for debugging
  13. # TRACE ON
  14.  
  15. # reset maximum login timeout. 
  16. SetTimeout      90
  17.  
  18. # Get username from access method
  19. # if the Username field is empty, abort.
  20. CfgGetValue "Username" username
  21. IF result = 0 THEN
  22.     ABORT "ERROR: cannot load username from Qdeck.ini."
  23. ENDIF
  24.  
  25. # get password from access method
  26. # if the Password field is empty, abort.
  27. CfgGetValue "Password" password
  28. IF result = 0 THEN
  29.     ABORT "ERROR: cannot load username from Qdeck.ini."
  30. ENDIF
  31.  
  32. # get framing layer (MPPPP, MPSLIP)
  33. # abort with an error if we can't read the Framing setting
  34. CfgGetValue "Framing" framing
  35. IF result = 0 THEN
  36.     ABORT "Can't read 'Framing' setting from qdeck.ini"
  37. ENDIF
  38.  
  39. CommWaitFor "login:"           # wait for login prompt
  40.  
  41. # The character before the user name indicates the type of connection.
  42.  
  43. IF framing = "MPPPP" THEN
  44.     CommSend   "P"
  45. ENDIF
  46. IF framing = "MPSLIP" THEN
  47.     CommSend   "S"
  48. ENDIF
  49.  
  50. CommSend    username            # send user name
  51. CommSend    "%r"                # send carriage return
  52.  
  53. CommWaitFor  "Password:"        # wait for password prompt
  54.     CommSend password           # send password
  55.     CommSend "%r"               # send carriage return
  56.  
  57. IF framing = "MPSLIP" THEN
  58.     CommWaitFor "to "
  59.     CommReadIPAddr IPAddress
  60.     IF result>0 THEN
  61.         CfgSetValue "IPAddress" IPAddress
  62.         PRINT "%rIP Address set to ["; IPAddress; "]"
  63.     ENDIF
  64. ENDIF
  65.  
  66. END                             # indicate success if we got this far
  67.  
  68.